package com.gun.controller;

/**
 * @Authar: 吾图南
 * @Data: 2022/12/9 21:05
 * @Package: com.gun.controller
 * @ClassName: LoginController
 * @Description: TODO
 */
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.Calendar;


@Controller
public class LoginController {
    /**
     * 获取并封装当前年份跳转到登录页login.html
     * @param model
     * @return
     */
    @GetMapping("/toLoginPage")
    public String toLoginPage(Model model){

        // 数据模型
        model.addAttribute("currentYear", Calendar.getInstance().get(Calendar.YEAR));
        // 返回一个视图
        return "login";
    }
}

